feat: add InvokeSentryResult::Events() to extract events from envelopes#137
Merged
feat: add InvokeSentryResult::Events() to extract events from envelopes#137
InvokeSentryResult::Events() to extract events from envelopes#137Conversation
Contributor
|
vaind
reviewed
Jan 5, 2026
| } | ||
| } | ||
| } | ||
| catch { } |
Contributor
There was a problem hiding this comment.
Why do we need to swallow exceptions here? If it's because of the access to event_id, you could use for example $header | Select-Object -ExpandProperty event_id -ErrorAction SilentlyContinue or $header.PsObject.Properties['event_id']?.Value
vaind
reviewed
Jan 5, 2026
| $header = $lines[0].Trim() | ConvertFrom-Json | ||
| if ($header.event_id -and $ids -notcontains $header.event_id) | ||
| { | ||
| $body = $lines | Select-Object -Skip 1 | Where-Object { |
Contributor
There was a problem hiding this comment.
This assumes single event in an envelope - is that OK?
Collaborator
Author
There was a problem hiding this comment.
I think so. According to the docs, "event" items may occur at most once per envelope: https://develop.sentry.dev/sdk/data-model/envelope-items/#event
vaind
approved these changes
Jan 5, 2026
jpnurmi
added a commit
to getsentry/sentry-dotnet
that referenced
this pull request
Jan 5, 2026
NOTE: requires latest github-workflows: getsentry/github-workflows#137
This was referenced Jan 5, 2026
jpnurmi
added a commit
to getsentry/sentry-dotnet
that referenced
this pull request
Jan 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR provides a solution to the problem described in
Problem
Sentry.NET integration tests run Android apps twice:
SentrySDK.CauseCrash(CrashType.Java). It might succeed in sending the crash envelope to Sentry right away, or hit a timeout and leave the envelope cached on disk.The problem is that the request from the first run might go through to the server, while the client hits a timeout and quits before receiving a response back. In this case, the second run sends the cached envelope again. While a real Sentry server would discard the duplicate, the test server records both, causing test assertions to fail.
Solution
InvokeSentryResult::Events()extracts unique event payloads from envelopes.